package com.mhf.feign;

import com.mhf.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFallbackFactory implements FallbackFactory<UserSevice> {
    @Override
    public UserSevice create(Throwable throwable) {
        return new UserSevice() {
            @Override
            public User getById(Long id) {
                return new User(-1L,"openfeign熔断","这个服务有问题");
            }
        };
    }
}
